package com.pattern.composite;

/**
 * @author 冯志立
 * @create 2019-10-31 10:33
 */
public class Client {
    public static void main(String[] args) {
        //从大到小创建对象
        OrganizationComponent university = new University("清华大学", "别人的大学");
        OrganizationComponent computerCollege = new College("计算机学院", "别人的学院");
        OrganizationComponent infoEngineerCollege = new College("信息工程学院", "别人的学院");

        computerCollege.add(new Department("软件工程", "软件工程"));
        computerCollege.add(new Department("网络工程", "软件工程"));
        computerCollege.add(new Department("计算机科学与技术", "软件工程"));

        infoEngineerCollege.add(new Department("通信工程", "不好学"));
        infoEngineerCollege.add(new Department("信息工程", "好学"));

        university.add(computerCollege);
        university.add(infoEngineerCollege);

        university.print();
    }
}
